#include <bits/stdc++.h>
#define ll long long
using namespace std;
set<int> s;
int cnt[100005]={0};
int n=0,ans=0;
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		int x;scanf("%d",&x);
		s.insert(x);
		cnt[x]++;
	}
	int lst=-1;int ntbk=0;
	while(!s.empty()){
		int x=*s.begin();
		s.erase(s.begin());
		if(lst==-1){lst=cnt[x];continue;}
		ans+=min(lst,cnt[x]);
		if(lst>cnt[x])ntbk+=(lst-cnt[x]);
		else if(cnt[x]>lst){
			ans+=min(ntbk,cnt[x]-lst);
			ntbk-=min(ntbk,cnt[x]-lst);
		}
		lst=cnt[x];
	}
	printf("%d\n",n-ans);
	return 0;
}
